package org.jeecg.modules.rental.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.model.EnumDictOption;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.modules.rental.entity.RentalStoreCategory;
import org.jeecg.modules.rental.mapper.RentalStoreCategoryMapper;
import org.jeecg.modules.rental.service.IRentalStoreCategoryService;
import org.jeecg.modules.rental.vo.StoreCategoryVO;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: rental_store_category
 * @Author: jeecg-boot
 * @Date:   2024-06-18
 * @Version: V1.0
 */
@Service
public class RentalStoreCategoryServiceImpl extends ServiceImpl<RentalStoreCategoryMapper, RentalStoreCategory> implements IRentalStoreCategoryService {

    @Override
    public List<EnumDictOption> selectOptions() {
        LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
        return baseMapper.selectOptions(loginUser.getOrgCode()+"%");
    }

    @Override
    public IPage<RentalStoreCategory> selectJoinPage(Page page, RentalStoreCategory storeCategory) {
        Page<RentalStoreCategory> pageList = baseMapper.selectJoinPage(page, storeCategory);
        return pageList;
    }

    @Override
    public List<StoreCategoryVO> selectOptionList() {
        return baseMapper.selectOptionList();
    }
}
